package com.example.googlemapdrawroutelast;

import java.util.Locale;

import android.app.Activity;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class UrlClass {

	//public static final String url = "192.168.78.71";

	public static String url = "192.168.78.71";

	/*public UrlClass(String url)
	{
		this.url = url;
	}*/
	public static void setUrl(String url) {
		UrlClass.url = "192.168.78." + url;
	}
	
	public static String getUrl() {
		return url;
	}
	
/*	public static String getUrl() {
		return url;
	}*/
	
	//return ip mobilephone
	public static String getIp(Object systemService) {

        WifiManager wifiManager = (WifiManager) systemService;
        WifiInfo info = wifiManager.getConnectionInfo();
        int i = info.getIpAddress();
        String ip = String.format(Locale.ENGLISH,"%d.%d.%d.%d", i & 0xff, i >> 8 & 0xff,i >> 16 & 0xff,i >> 24 & 0xff);
        return ip;
    }

}
